package com.zh.zcy.config;

/**
 * 自定义返回格式
 */
public class Message {
    private Integer code;
    private String msg;
    private Object obj;


    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public Object getObj() {
        return this.obj;
    }

    public Message() {
    }

    public Message(Integer code, String msg, Object obj) {
        this.code = code;
        this.msg = msg;
        this.obj = obj;
    }

    public static Message success(){
        return new Message(200,"",null);
    }
    public static Message success(Object data){
        return new Message(200,"操作成功！",data);
    }
    public static Message error(Integer code,String msg){
        return new Message(code,msg,null);
    }
    public static Message error(){
        return new Message(500,"系统错误",null);
    }
}
